﻿@model List<HotDealD2.Models.ModelView.PromotionStatisticView>
           
@using (Html.BeginForm("RegisterPromotion", "Business", FormMethod.Get, new { id = "registerPromotion" })) { }
@using (Html.BeginForm("ListPromotion", "Business", FormMethod.Get, new { id = "updateListPromotion" })) { }

@{
    Layout = "../Shared/BusinessLayout.cshtml";
}

<html xmlns="http://www.w3.org/1999/xhtml" lang="vn">
<head>
    <title>Đơn hàng - HotDeal.vn: Cùng mua chung, mua theo nhóm, mua deal giá rẻ</title>
    <meta http-equiv="Content-Language" content="vn" />
    <meta name="description" content="Cùng mua chung theo nhóm, mua các deal sản phẩm và dịch vụ giảm giá, rẻ tới 90%: mua sắm, du lịch, làm đẹp, ăn uống, nhà hàng, thời trang, spa tại HotDeal.vn" />
    <meta name="keywords" content="hotdeal, hotdeals, hot deal, mua hàng theo nhóm,mua chung, nhóm mua, cùng mua, deal, deals, giá tốt, giá rẻ, giảm giá, khuyến mại, ưu đãi, Group Buy, daily deals" />
    <meta name="SKYPE_TOOLBAR" content="SKYPE_TOOLBAR_PARSER_COMPATIBLE" />
    <meta name="robots" content="noindex" />
    <link type="text/css" href="../../../../Content/BusinessSite/stylesheets/IndexBusiness.css" rel="stylesheet"/>
    <link href="@Url.Content("~/Content/themes/base/jquery-ui.css")" rel="stylesheet" type="text/css" />
    <script src="@Url.Content("~/Scripts/EditorHookup.js")" type="text/javascript"></script>
</head>
<body class="c-orders m-search cm-orders-search">                                   
    <div class="content_general">
        <h1 class="mainbox-title"><span>Quản lý Deal</span></h1>
        <div class="mainbox-body">
            <div class="section-border search-form" id="ds_1798439440">
                <h2 class="subheader">
                    Thống kê Deal
                </h2>
                
                <div id="s_8929ef313c0fd6e43446cc0aa86b70cd" class="section-body ">	
                    <form action="Business/ListPromotion" name="orders_search_form" method="get">
                        
                        <div class="buttons-container" style="text-align:left">
                            <span   class="button-submit"><input  onclick="$('#updateListPromotion').submit()" type="button" name="dispatch[orders.search]"  value="Cập nhật" /></span>
                            <span   class="button-submit"><input  onclick="$('#registerPromotion').submit()" type="button" name="dispatch[orders.search]"  value="Đăng tin khuyến mãi"/></span>
                            
                        </div>
           
                        <table border="5" cellpadding="0" cellspacing="0" width="100%" class="table">
                            <tr class="center">
                            
                                <th class="center" width="4%"><a class="" rev="pagination_contents">ID</a></th>
                                <th class="center" width="20%">Tên deal</th>
                                <th class="center" width="10%"><a class="" rev="pagination_contents">Ngày đăng</a></th>
                                <th class="center" width="10%"><a class="" rev="pagination_contents">Hạn sử dụng</a></th>
                                <th class="center" width="10%"><a class="" rev="pagination_contents">Giá tốt</a></th>
                                <th class="center" width="10%"><a class="" rev="pagination_contents">Số lượng tối đa</a></th>
                                <th class="center" width="10%"><a class="" rev="pagination_contents">Đơn giá (VNĐ)</a></th>
                                <th class="center" width="10%"><a class="" rev="pagination_contents">Số lượng</a></th>
                                <th class="center" width="10%"><a class="" rev="pagination_contents">Thành tiền (VNĐ)</a></th>
                                <th class="center" ><a rev="pagination_contents">Tình trạng</a></th>
                    
                            </tr>
                            @{
                                bool isOdd = true;
                                foreach (var item in Model)
                                {
                                    if (isOdd)
                                    {
                                        <tr class="center">
                                            <td class="center">
                                                <a href="/chi-tiet-don-hang?order_id=2058950"><strong>@Html.DisplayFor(m => item.IDPromotion)</strong></a>
                                            </td>
                                            
                                           

                                            @if (item.IDPromotion != null)
                                            {
                                                <td class="center" >
                                                    <ul class="no-markers">
                                                        <li><a title="Xem chi tiết và bình luận" href="@Url.Action("DealDetail", "Home", new { id = item.IDPromotion.Value })"><strong>@Html.DisplayFor(m => item.TenDeal)</strong></a></li>
                                                    </ul>
                                                </td>

                                                <td class="center" ><a href="@Url.Action("ListOrDered", new { id = item.IDPromotion })">@Html.DisplayFor(m => item.NgayDang)</a></td>
                                                <td class="center" ><a href="@Url.Action("ListOrDered", new { id = item.IDPromotion })">@Html.DisplayFor(m => item.HanSuDung)</a></td>
                                                <td class="center" ><a href="@Url.Action("ListOrDered", new { id = item.IDPromotion })">@Html.DisplayFor(m => item.TinhTrangGiaTot)</a></td>
                                                <td class="center" ><a href="@Url.Action("ListOrDered", new { id = item.IDPromotion })">@Html.DisplayFor(m => item.SoLuongToiDa)</a></td>
                                                <td class="center" ><a href="@Url.Action("ListOrDered", new { id = item.IDPromotion })">@Html.DisplayFor(m => item.GiaTien)</a></td>
                                                <td class="center" ><a href="@Url.Action("ListOrDered", new { id = item.IDPromotion })">@Html.DisplayFor(m => item.TongSoDonHang)</a></td>
                                                <td class="center" ><a href="@Url.Action("ListOrDered", new { id = item.IDPromotion })">@Html.DisplayFor(m => item.ThongKeSoTien)</a></td>
                                                <td class="center" ><a href="@Url.Action("ListOrDered", new { id = item.IDPromotion })">@Html.DisplayFor(m => item.TinhTrang)</a></td>
                                            }
                                            else
                                            {
                                                <td class="center" >
                                                    <ul class="no-markers">
                                                        <li>@Html.DisplayFor(m => item.TenDeal)</li>
                                                    </ul>
                                                </td>
                                                <td class="center" >@Html.DisplayFor(m => item.NgayDang)</td>
                                                <td class="center" >@Html.DisplayFor(m => item.HanSuDung)</td>
                                                <td class="center" >@Html.DisplayFor(m => item.TinhTrangGiaTot)</td>
                                                <td class="center" >@Html.DisplayFor(m => item.SoLuongToiDa)</td>
                                                <td class="center" >@Html.DisplayFor(m => item.GiaTien)</td>
                                                <td class="center" >@Html.DisplayFor(m => item.TongSoDonHang)</td>
                                                <td class="center" >@Html.DisplayFor(m => item.ThongKeSoTien)</td>
                                                <td class="center" >@Html.DisplayFor(m => item.TinhTrang)</td>
                                            }
                                            
                                            
                                        </tr>
                                            isOdd = false;
                                    }
                                    else
                                    { 
                                        <tr class="table-row">
                                            <td class="center">
                                                <a href="@Url.Action("ListOrDered", new { id = item.IDPromotion })"><strong>@Html.DisplayFor(m => item.IDPromotion)</strong></a>
                                            </td>
                                            
                                            @if (item.IDPromotion != null)
                                            {
                                                <td>
                                                    <ul class="no-markers">
                                                        <li><a title="Xem chi tiết và bình luận" href="@Url.Action("DealDetail", "Home", new { id = item.IDPromotion.Value })"><strong>@Html.DisplayFor(m => item.TenDeal)</strong></a></li>
                                                    </ul>
                                                </td>

                                                <td class="center" ><a href="@Url.Action("ListOrDered", new { id = item.IDPromotion })">@Html.DisplayFor(m => item.NgayDang)</a></td>
                                                <td class="center" ><a href="@Url.Action("ListOrDered", new { id = item.IDPromotion })">@Html.DisplayFor(m => item.HanSuDung)</a></td>
                                                <td class="center" ><a href="@Url.Action("ListOrDered", new { id = item.IDPromotion })">@Html.DisplayFor(m => item.TinhTrangGiaTot)</a></td>
                                                <td class="center" ><a href="@Url.Action("ListOrDered", new { id = item.IDPromotion })">@Html.DisplayFor(m => item.SoLuongToiDa)</a></td>
                                                <td class="center" ><a href="@Url.Action("ListOrDered", new { id = item.IDPromotion })">@Html.DisplayFor(m => item.GiaTien)</a></td>
                                                <td class="center" ><a href="@Url.Action("ListOrDered", new { id = item.IDPromotion })">@Html.DisplayFor(m => item.TongSoDonHang)</a></td>
                                                <td class="center" ><a href="@Url.Action("ListOrDered", new { id = item.IDPromotion })">@Html.DisplayFor(m => item.ThongKeSoTien)</a></td>
                                                <td class="center" ><a href="@Url.Action("ListOrDered", new { id = item.IDPromotion })">@Html.DisplayFor(m => item.TinhTrang)</a></td>
                                            }
                                            else
                                            {
                                                <td class="center" >
                                                    <ul class="no-markers">
                                                        <li>@Html.DisplayFor(m => item.TenDeal)</li>
                                                    </ul>
                                                </td>
                                                <td class="center" >@Html.DisplayFor(m => item.NgayDang)</td>
                                                <td class="center" >@Html.DisplayFor(m => item.HanSuDung)</td>
                                                <td class="center" >@Html.DisplayFor(m => item.TinhTrangGiaTot)</td>
                                                <td class="center" >@Html.DisplayFor(m => item.SoLuongToiDa)</td>
                                                <td class="center" >@Html.DisplayFor(m => item.GiaTien)</td>
                                                <td class="center" >@Html.DisplayFor(m => item.TongSoDonHang)</td>
                                                <td class="center" >@Html.DisplayFor(m => item.ThongKeSoTien)</td>
                                                <td class="center" >@Html.DisplayFor(m => item.TinhTrang)</td>
                                            }
                                        </tr>
                                        isOdd = true;
                                    }
                                }
                            }
                            <tr class="table-footer">
                                <td colspan="10">&nbsp;</td>
                            </tr>
                        </table>
                    </form>
                    
                </div>
            </div>
            <br />
            
        </div>
    </div>  
</body>
</html><!--WSS-->
